package tables;

import java.sql.Blob;

public class Commodity {
    private int commodity_id;
    private double commodity_price;
    private String commodity_name;
    private Blob commodity_img;
    private String commodity_brand;
    private int commodity_amount;
    private String commodity_type;

    public Commodity(){}

    /**
     * 有图片时用这个构造器
     * @param commodity_id
     * @param commodity_price
     * @param commodity_name
     * @param commodity_img
     * @param commodity_brand
     * @param commodity_amount
     * @param commodity_type
     */
    public Commodity(int commodity_id, double commodity_price, String commodity_name, Blob commodity_img, String commodity_brand, int commodity_amount, String commodity_type) {
        this.commodity_id = commodity_id;
        this.commodity_price = commodity_price;
        this.commodity_name = commodity_name;
        this.commodity_img = commodity_img;
        this.commodity_brand = commodity_brand;
        this.commodity_amount = commodity_amount;
        this.commodity_type = commodity_type;
    }

    /**
     * 没有图片时用这个构造方法
     * @param commodity_id
     * @param commodity_price
     * @param commodity_name
     * @param commodity_brand
     * @param commodity_amount
     * @param commodity_type
     */
    public Commodity(int commodity_id, double commodity_price, String commodity_name, String commodity_brand, int commodity_amount, String commodity_type) {
        this.commodity_id = commodity_id;
        this.commodity_price = commodity_price;
        this.commodity_name = commodity_name;
        this.commodity_brand = commodity_brand;
        this.commodity_amount = commodity_amount;
        this.commodity_type = commodity_type;
    }

    public int getId() {
        return commodity_id;
    }

    public double getCommodity_price() {
        return commodity_price;
    }

    public void setCommodity_price(double commodity_price) {
        this.commodity_price = commodity_price;
    }

    public String getCommodity_name() {
        return commodity_name;
    }

    public void setCommodity_name(String commodity_name) {
        this.commodity_name = commodity_name;
    }

    public Blob getCommodity_img() {
        return commodity_img;
    }

    public void setCommodity_img(Blob commodity_img) {
        this.commodity_img = commodity_img;
    }

    public String getCommodity_brand() {
        return commodity_brand;
    }

    public void setCommodity_brand(String commodity_brand) {
        this.commodity_brand = commodity_brand;
    }

    public int getCommodity_amount() {
        return commodity_amount;
    }

    public void setCommodity_amount(int commodity_amount) {
        this.commodity_amount = commodity_amount;
    }

    public String getCommodity_type() {
        return commodity_type;
    }

    public void setCommodity_type(String commodity_type) {
        this.commodity_type = commodity_type;
    }

    public String toString() {
        return "Commodity{" +
                "commodity_id=" + commodity_id +
                ", commodity_price=" + commodity_price +
                ", commodity_name='" + commodity_name + '\'' +
                ", commodity_brand='" + commodity_brand + '\'' +
                ", commodity_amount=" + commodity_amount +
                ", commodity_type='" + commodity_type + '\'' +
                "}";
    }

//    public static void main(String[] args) {
//        Commodity c = new Commodity(1,2.0,"123","erke",100,"上衣");
//        System.out.println(c.toString());
//    }


}
